/****************************************
 * 2018 - 2021 版权所有 CopyRight(c) 快程乐码信息科技有限公司所有, 未经授权，不得复制、转发
 */

package com.kclm.xsap.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;



@Configuration
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer {
//    private final String TEACHER_UPLOAD_IMAGE_URL;
//    private final String MEMBER_UPLOAD_IMAGE_URL;
//
//    public WebMvcConfig() {
//        log.debug("虚拟映射路径处理");
//        String homeDir = System.getProperty("user.dir");
//        TEACHER_UPLOAD_IMAGE_URL = "file:" + homeDir + "/upload/images/teacher_img/";
//        log.debug("\n----> 教师上传的图片映射路径：{}",TEACHER_UPLOAD_IMAGE_URL);
//        MEMBER_UPLOAD_IMAGE_URL = "file:" + homeDir + "/upload/images/member_img/";
//        log.debug("\n----> 会员上传的图片映射路径：{}",MEMBER_UPLOAD_IMAGE_URL);
//    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/images/member_img/**")
//                .addResourceLocations(MEMBER_UPLOAD_IMAGE_URL);
//        //添加一个文件上传的静态路径映射, 如果是文件目录，则需要以 file: 开头
//        registry.addResourceHandler("/images/teacher_img/**")
//                .addResourceLocations(TEACHER_UPLOAD_IMAGE_URL);
//
//    }


}
